import React from "react";
import IconFont from "@/components/IconFont";
import {IconEnum} from "@/utils/IconEnum.ts";
import {IUserInfo} from "@/api/authentication.ts";

const UserInfoCard: React.FC<{ user: IUserInfo }> = ({user}) => {

  return (
    <div className="user-detail-box-left-list">
      <div className="user-detail-box-left-list-item">
        <IconFont icon={IconEnum.NICKNAME}/>&nbsp;&nbsp;
        <span><label>昵称:</label>{user.nickName}</span>
      </div>
      <div className="user-detail-box-left-list-item">
        <IconFont icon={IconEnum.SEX_GIRL}/>&nbsp;&nbsp;
        <span><label>性别:</label>{user.sex === '0' ? '男' : '女'}</span>
      </div>
      <div className="user-detail-box-left-list-item">
        <IconFont icon={IconEnum.IDENTITY}/>&nbsp;&nbsp;
        <span><label>身份:</label>{user.userType === '0' ? '管理员' : '普通用户'}</span>
      </div>
      <div className="user-detail-box-left-list-item">
        <IconFont icon={IconEnum.EMAIL}/>&nbsp;&nbsp;
        <span><label>邮箱:</label>{user.email}</span>
      </div>
      <div className="user-detail-box-left-list-item">
        <IconFont icon={IconEnum.DATE}/>&nbsp;&nbsp;
        <span><label>登录时间:</label>{user.loginDate as string}</span>
      </div>
      <div className="user-detail-box-left-list-item">
        <IconFont icon={IconEnum.POSITIONING}/>&nbsp;&nbsp;
        <span><label>登录IP:</label>{user.loginIp}</span>
      </div>
    </div>
  )
}

export default UserInfoCard